package com.github.gdxmap.layer.format;

import android.util.Log;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.github.gdxmap.layer.Layer;
import com.github.gdxmap.layer.vector.VectorNode;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by free on 2016/12/7 0007.
 */
public class VectorLayer extends Layer {
    protected List<VectorNode> vectorLayerNodeList;

    public VectorLayer() {
        vectorLayerNodeList = new ArrayList<>(20);
    }

    @Override
    public void render() {
        for (VectorNode node : vectorLayerNodeList) {
            polygonSpriteBatch.begin();

            node.renderFill(polygonSpriteBatch);

            polygonSpriteBatch.end();
        }
    }

    @Override
    public void addRender() {

    }

    @Override
    public void exitRender() {
        if (vectorLayerNodeList != null) {
            vectorLayerNodeList.clear();
        }
    }

    public List<VectorNode> getVectorLayerNodeList() {
        return vectorLayerNodeList;
    }

    public void setVectorLayerNodeList(List<VectorNode> vectorLayerNodeList) {
        this.vectorLayerNodeList = vectorLayerNodeList;
    }
}
